<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>jQuery多张图片批量上传插件</title>

<script src="jquery.js"></script>



<link rel="stylesheet" type="text/css" href="diyUpload/css/webuploader.css">

<link rel="stylesheet" type="text/css" href="diyUpload/css/diyUpload.css">

<script type="text/javascript" src="diyUpload/js/webuploader.html5only.min.js"></script>

<script type="text/javascript" src="diyUpload/js/diyUpload.js"></script>

</head>

<style>

*{ margin:0; padding:0;}

#box{ margin:50px auto; width:540px; min-height:400px; background:#FF9}

#demo{ margin:50px auto; width:540px; min-height:800px; background:#CF9}

</style>

<body>

<!--java上传，struts1，struts2，springMVC都支持  -->
<div id="box">

	<div id="test" ></div>

</div>


<!-- php上传 -->
<!-- <div id="demo">

	<div id="as" ></div>

</div>
 -->
</body>

<script type="text/javascript">



/*

* 服务器地址,成功返回,失败返回参数格式依照jquery.ajax习惯;

* 其他参数同WebUploader

*/

//Java上传

$('#test').diyUpload({

	url:'<%=basePath%>/UploadPhotoServlet',

	success:function( data ) {

		console.info( data );

	},

	error:function( err ) {

		console.info( err );	

	}

});

//php上传

$('#as').diyUpload({

	url:'server/fileupload.php',

	success:function( data ) {

		console.info( data );

	},

	error:function( err ) {

		console.info( err );	

	},

	buttonText : '选择文件',

	chunked:true,

	// 分片大小

	chunkSize:512 * 1024,

	//最大上传的文件数量, 总文件大小,单个文件大小(单位字节);

	fileNumLimit:50,

	fileSizeLimit:500000 * 1024,

	fileSingleSizeLimit:50000 * 1024,

	accept: {}

});

</script>



</html>

